﻿<Window x:Class="PDO.FX.App.ExpressionEvaluatorPopup"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    SizeToContent="Height" 
              WindowStartupLocation="CenterOwner"
              Title="PDO Expression Evaluator"
    Style="{DynamicResource NCISpopupDialogStyle}"
     Width="800" MinHeight="200">

    <Grid Margin="{DynamicResource NCISpageMargin}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <TextBlock Grid.Row="0" Name="_dataContextObjectName" Text="{Binding Path=DataContextObjectName}" />
            <Label Grid.Row="1"  Content="Expression:"/>
            <TextBox Grid.Row="2" Name="_expression" TextWrapping="Wrap" KeyUp="OnExpressionKeyDown" MinHeight="100"/>

            <Label Grid.Row="3"  Content="Result:"/>
            <Grid Grid.Row="4" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>

                <TextBox Name="result" />
                <Button Grid.Column="1" Name="_evaluateBtn"  Click="evaluateBtn_Click" IsDefault="True" >Evaluate</Button>
                <Button Grid.Column="2" Name="_saveBtn"  Click="saveBtn_Click" >Save</Button>
            </Grid>

            <Label Grid.Row="5"  Content="Messages:"/>
            <TextBox Grid.Row="6" Name="error" VerticalScrollBarVisibility="Auto" MinHeight="100"/>


            <Popup Grid.Row="0" Grid.RowSpan="9" x:Name="_popupProperties"  
                           StaysOpen="False" Placement="Bottom" IsOpen="false" 
                           HorizontalAlignment="Left">
                <Grid >
                    <ListBox x:Name="_propertySelector" MaxHeight="300" MinWidth="200"
                                     ItemsSource="{Binding Path=IntellisenseOptions, Mode=OneWay}"
                                     ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                                     ScrollViewer.VerticalScrollBarVisibility="Auto" 
                                     KeyDown="OnListKeyDown" 
                                     SelectedIndex="0" 
                                     IsTextSearchEnabled="True" 
                            />
                </Grid>
            </Popup>


        </Grid>
    </Grid>
</Window>
